<template>
  <div id="check-detail-management" class="component-wrap">
    <Title :title-msg="titleMsg"></Title>
    <ul class="check-detail-tab">
      <li @click="changeTab(index)" v-for="(item,index) in tabItem" :key="index">
        <span :class="{ 'hover':index===cur }">{{item}}({{index}})</span>
      </li>
    </ul>
    <div class="title-tip">
      <div class="title-tip-content clearfix">
        <p class="total" v-if="cur===0">小计：{{cur}}</p>
        <p class="total" v-if="cur===1">小计：{{cur}}</p>
        <p class="total" v-if="cur===2">小计：{{cur}}</p>
        <p class="total" v-if="cur===3">小计：{{cur}}</p>
        <p class="choose">
          筛选
          <span></span>
        </p>
      </div>
    </div>
    <div class="check-detail-list">
      <List v-for="(item,index) in lists" :key="index" :item="item"></List>
    </div>
    <img src="../../assets/ic_add@3x.png" class="add"/>
  </div>
</template>

<script type="text/ecmascript-6">
  import Title from '@/components/common/Title.vue'
  import List from '@/components/common/List.vue'

  const list= {
    "assetCode": "0281219-1223",
    "assetName": "戴尔台式机",
    "assetType": "办公用品",
    "assetGroup": "电脑一体机",
    "assetOri": "聚好联产品开发",
    "assetPosition": "青岛市崂山区松岭路399号",
    "assetStatus": 1
  }

  export default {
    name: "checkDetailManagement",
    data:function(){
      return {
        titleMsg: {
          title: "盘点单详情",
          back: true,
          scan: true,
          search: true
        },
        lists: [ list, list, list, list ],
        cur: 0,
        tabItem: ["未盘","已盘","盘盈","盘亏"]
      }
    },
    methods: {
      changeTab:function(idx){
        this.cur = idx
      }
    },
    components: {
      Title: Title,
      List: List
    }
  }
</script>

<style scoped>
  #check-detail-management .check-detail-tab {
    position: fixed;
    left: 0;
    right: 0;
    top: 4.4rem;
    width: 100%;
    height: 4.4rem;
    background: #fff;
    overflow: hidden;
    z-index: 2;
    border-bottom: 1px solid #eee;
    display: flex;
  }
  #check-detail-management .check-detail-tab li{
    flex: 1;
    height: 4.4rem;
    line-height: 4.4rem;
    text-align: center;
    font-size: 1.4rem;
    color: #999;
  }
  #check-detail-management .check-detail-tab li .hover {
    color: #4A4A4A;
    font-weight: bold;
    padding: 0.4rem 0;
    border-bottom: 0.2rem solid #0CC;
  }
  #check-detail-management .title-tip {
    position: fixed;
    left: 0;
    right: 0;
    top: 8.8rem;
    width: 100%;
    z-index: 2;
  }
  #check-detail-management .title-tip .title-tip-content {
    width: 100%;
    height: 4.4rem;
    background: #FFFFFF;
    -webkit-box-shadow: 0 0.2rem 0.5rem 0 rgba(166,187,187,0.45);
    -o-box-shadow: 0 0.2rem 0.5rem 0 rgba(166,187,187,0.45);
    -moz-box-shadow: 0 0.2rem 0.5rem 0 rgba(166,187,187,0.45);
    -ms-box-shadow: 0 0.2rem 0.5rem 0 rgba(166,187,187,0.45);
    box-shadow: 0 0.2rem 0.5rem 0 rgba(166,187,187,0.45);
  }
  #check-detail-management .title-tip .total {
    float: left;
    height: 4.4rem;
    line-height: 4.4rem;
    font-size: 1.4rem;
    color: #4A4A4A;
    margin-left: 1.5rem;
    font-weight: bold;
  }
  #check-detail-management .title-tip .choose {
    float: right;
    height: 4.4rem;
    line-height: 4.4rem;
    color: #999999;
    font-size: 1.4rem;
    margin-right: 3rem;
    position: relative;
  }
  #check-detail-management .title-tip .choose span {
    position: absolute;
    top: 50%;
    right: -1.6rem;
    width: 1.2rem;
    height: 1.2rem;
    background: url("../../assets/ic_filter_down@3x.png") no-repeat center center;
    -webkit-background-size: 100% 100%;
    background-size: 100% 100%;
    margin-top: -0.6rem;
  }
  #check-detail-management .check-detail-list {
    position: fixed;
    top: 14.8rem;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    padding-top: 0.5rem;
  }
</style>
